<form nz-form class="login-form" [formGroup]="loginForm" (ngSubmit)="doLogin()">
    <nz-form-item>
        <nz-form-control>
            <nz-input-group [nzSize]="'large'">
                <input id="phoneNumberEle" type="text" nz-input formControlName="phoneNumber" placeholder="请输入手机号码"
                       autofocus>
            </nz-input-group>
            <nz-form-explain
                *ngIf="loginForm.get('phoneNumber').dirty && loginForm.get('phoneNumber').hasError('required')">
                请输入手机号码
            </nz-form-explain>
            <nz-form-explain
                *ngIf="loginForm.get('phoneNumber').dirty && loginForm.get('phoneNumber').hasError('phoneNumber')">
                请输入正确的手机号码
            </nz-form-explain>
        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-control>
            <nz-input-group [nzSize]="'large'">
                <input type="text" class="valid-code" nz-input formControlName="validCode" placeholder="请输入验证码"
                       autofocus>
                <button nz-button (click)="sendSMS()" type="button"
                        [disabled]="inEffectiveTime"
                        style="height: 40px;width:118px;">{{inEffectiveTime ? effectiveTime + '秒后可重发' : '获取验证码'}}</button>
            </nz-input-group>
            <nz-form-explain
                *ngIf="loginForm.get('validCode').dirty && loginForm.get('validCode').hasError('required')">
                请输入验证码
            </nz-form-explain>
        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-control>
            <!--<a routerLink="/register">登录</a>-->
            <a routerLink="/register">注册账号</a>
            <nz-divider nzType="vertical"></nz-divider>
            <a (click)="changeLoginWay()">账户密码登录</a>
            <button nz-button nzType="primary" nzSize="large" class="login-button" style="height:34px;"
                    [nzLoading]="logging"
                    [disabled]="!loginForm.valid"
                    class="login-button">登陆
            </button>
        </nz-form-control>
    </nz-form-item>
</form>
